<template>
  <div id="menu">
    <div class="menu">
      <ol>
        <li v-for="(item, index) in list">
          <i class="el-icon-edit"></i><router-link :to="'/content/'+ item + '?mid=' + index">{{item}}</router-link>
        </li>
        <li>
          <button @click="jsRouter()">js跳转</button>
        </li>
        <li>
          {{this.$store.state.count}}
        </li>
        <li>
          <button @click="addCount">添加</button>
        </li>
      </ol>
    </div>
  </div>
</template>

<script>

  import store from '../plugs/vuex/store';

  export default {
    data() {
      return {
        list: ["次啊单1", "菜单2"]
      }
    },
    store,
    methods:{
      jsRouter(){
        this.$router.push({path: '/header'})
      },
      addCount(){
        this.$store.commit('addCount')
      }
    }
  }
</script>

<style scoped>
  .menu {
    height: 100%;
    width: 300px;
    background-color: cadetblue;
  }
</style>
